package com.zc.test.kotlinlearn.controller

data class User(private var name: String, private val age: Int)



open class Persion constructor(val name: String) {
    val firstProperty = "First property: $name".also(::println)
    init {

    }

    constructor(age: Int) : this("zc") {
        print(age)
    }

    fun hello(w : String = "word", p : () -> Unit) {
        p()
        print(w)
    }
}

class Chinases(name: String) : Persion(name) {
    val lazyValue: String by lazy(LazyThreadSafetyMode.NONE) {
        println("computed!")
        "Hello"
    }
}

class P() {
     var name : String = "zc"
    set(value) {
        if (value == "z2c") field = value
    }
    get() =  field + "heh"

    var fName : String = "z"


}


fun main(args : Array<String>) {
    var persion = Persion("zc")
    persion = Persion(12)
    persion.hello("1") { println("heh") }

    var p = P()
    println("p name is ${p.name}")
    p.name = "zcc"
    println("p name is ${p.name}")
    p.name = "z2c"
    println("p name is ${p.name}")

}